<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>推荐商家</title>
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/css/mall.css" />	
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class=" mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
			<h1 class="mui-title">推荐商家</h1>
		</header>
		<div class="mui-content">
			<div class="my_memlisnav">
				<span>商家名称</span>
				<span>会员数</span>
				<span>鼓励金</span>
			</div>
			<ul class="my_memlis">
		 
			</ul>
		</div>
		<div id="footer"></div>
		<input type="hidden" id="page" value="1" />
	</body>

</html>
{include file="public/footer" /}
<script type="text/javascript" src="__INDEX__/js/menudown.js" ></script>
<script>
	$(document).ready(function(){
		$.ajax({
			type:"post",
			data:{ 
				page:$("#page").val()
			},
			url:"{:url('index/member/tglist3')}",
			success:function(data){	
				var list=data.list;
				var html=""; 
				if(list){ 
					for(var i=0;i<list.length;i++){
						var log=list[i]; 
						html+='<li class="clearfix">'
						       +"<span>"+log.agent_name+"</span>"
						       +"<span>"+log.mems+"</span>"
						       +"<span>"+log.pt_comm+"</span>"
				    		   +'</li>'
					}
				}else{
					html="没有记录";
				}
				$(".my_memlis").html(html);
				
			}
		});
	});
	
	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){
			var index = layer.load(1, {shade: false,time: 1.5 * 1000});
			$.ajax({
			type:"post",
			data:{ 
				page:parseFloat($("#page").val())+1
			},
			url:"{:url('index/member/tglist3')}",
			success:function(data){	
				layer.close(index);
				var list=data.list;
				var html="";
				if(list){ 
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
						var log=list[i]; 
						html+='<li class="clearfix">'
						       +"<span>"+log.agent_name+"</span>"
						       +"<span>"+log.mems+"</span>"
						       +"<span>"+log.pt_comm+"</span>"
				    		   +'</li>'
					}
				}else{
					html="已经到最后";
				}
				$(".my_memlis").append(html);
				
			}
		});
		
		}				
	})
</script>